<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="utf-8">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <meta name="viewport"
            content="width=device-width,initial-scale=1,user-scalable=yes">
        <link rel="icon" type="image/png" href="../../assets/favicon.ico">
        <!-- Google Tag Manager -->
        <script>(function (w, d, s, l, i) {
            w[l] = w[l] || []; w[l].push({
                'gtm.start':
                    new Date().getTime(), event: 'gtm.js'
            }); var f = d.getElementsByTagName(s)[0],
                j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
                    'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
        })(window, document, 'script', 'dataLayer', 'GTM-WQKS4BKW');</script>
        <!-- End Google Tag Manager -->
        <meta name="msapplication-TileColor" content="#808080">
        <meta name="msapplication-config"
            content="/wp-content/uploads/ico/browserconfig.xml">
        <meta name="theme-color" content="#808080">

        <link rel="stylesheet" href="./index.css">
        <!-- <title> onlinexzone.com</title> -->
        <meta name='robots' content='max-image-preview:large' />
        <meta property='og:type' content='article'>
        <meta property='og:title' content='a nice news station'>

        <meta property='og:locale' content='en_US'>
        <meta property='og:site_name' content='onlinexzone.com'>
        <!-- 这里放在线图 -->
        <meta property='og:image:width' content='868'>
        <meta property='og:image:height' content='1300'>
        <meta property='author' content='Ryan Pratt'>
        <meta property='twitter:label1' content='Written By'>
        <meta property='twitter:data1' content='Ryan Pratt'>
        <meta property='twitter:label2' content='Est. reading time'>

        <link rel="stylesheet" href="../public/public.css">
        <link rel="canonical" href="../../../index.html" />
        <!-- 换在线logo -->
        <meta name="msapplication-TileImage"
            content="https://onlinexzone.com/assets/logo.png" />
        <script async
            src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6907038225839490"
            crossorigin="anonymous"></script>
    </head>

    <body
        class="bi-pagetype-single post-template-default single single-post postid-22807 single-format-standard unified-pagetype-single unified-template-single unified-lang-en_US">
        <!-- noscript -->
        <noscript>
            <div class="no-js__notice">
                This website works best with JavaScript enabled. </div>
        </noscript>
        <!-- <a id="page-top" tabindex='-1'></a>
    <a class="skip-main" href="#main">Skip to main content</a> -->

        <div class="popout">
            <a class="popout__logo" href="https://onlinexzone.com/"
                aria-label="Go to onlineXzone.com Homepage">
                <img alt="onlinexZone.com logo" src="../../assets/logo.png"
                    class="popout__logo-image" width="160"
                    height="30.06" />
            </a>

            <button class="popout__close" type="button" aria-label="Close Menu">

            </button>

            <nav class="popout-nav" aria-label="Pop Out Site Menu">
                <ul id="menu-popout-menu-english" class="popout-nav__list">
                    <li id="menu-item-11654"
                        class="menu-item menu-item-type-taxonomy menu-item-object-category popout-nav__item menu-item-11654">
                        <a class="popout-nav__link" target="_parent"
                            href="https://onlinexzone.com/category/index.html?type=health">Health</a>
                    </li>
                    <li id="menu-item-11659"
                        class="menu-item menu-item-type-taxonomy menu-item-object-category popout-nav__item menu-item-11659">
                        <a class="popout-nav__link" target="_parent"
                            href="https://onlinexzone.com/category/index.html?type=travel">Travel</a>
                    </li>
                    <li id="menu-item-11657"
                        class="menu-item menu-item-type-taxonomy menu-item-object-category popout-nav__item menu-item-11657">
                        <a class="popout-nav__link" target="_parent"
                            href="https://onlinexzone.com/category/index.html?type=auto">Auto</a>
                    </li>
                    <li id="menu-item-11655"
                        class="menu-item menu-item-type-taxonomy menu-item-object-category popout-nav__item menu-item-11655">
                        <a class="popout-nav__link" target="_parent"
                            href="https://onlinexzone.com/category/index.html?type=finance">Finance</a>
                    </li>
                    <li id="menu-item-11656"
                        class="menu-item menu-item-type-taxonomy menu-item-object-category popout-nav__item menu-item-11656">
                        <a class="popout-nav__link" target="_parent"
                            href="https://onlinexzone.com/category/index.html?type=tech">Tech</a>
                    </li>
                </ul>
                <nav class="popout-secondary-nav"
                    aria-label="Pop Out Privacy Menu" style="padding: 0;">
                    <ul id="menu-popout-privacy-menu-english"
                        class="popout-secondary-nav__list cmp__menu">
                        <li id="menu-item-11660"
                            class="menu-item menu-item-type-custom menu-item-object-custom popout-secondary-nav__item menu-item-11660">
                            <a class="popout-secondary-nav__link"
                                target="_blank"
                                href="https://docs.google.com/document/d/17ydjwONuPcDChPCnV-DVzH6hqOB58B8TwUffEQvUYd4/pub">Privacy
                                Policy</a>
                        </li>

                    </ul>
                </nav>
                <!-- <iframe src="../../components/SidebarNav.html" style="height: 80vh;" frameborder="0" width="400px"></iframe> -->
            </nav>

        </div>
        <div class="overlay"></div>
        <header class="header">
            <!-- logo -->

            <div class="logoBox">
                <a class="logo" href="https://onlinexzone.com" target="_parent"
                    aria-label="Go to onlinexzone.com Homepage">
                    <img alt="onlinexzone.com logo" src="../../assets/logo.png"
                        class="logo__image" />
                </a>
                <button class="hamburger" type="button"
                    aria-label="Show Menu"><span
                        class="hamburger__span"></span></button>
            </div>

            <!-- mobile menu toggle -->

            <!-- primary menu -->
            <nav class="nav" aria-label="Site Menu">
                <ul id="menu-primary-menu-english" class="nav__list">
                    <li id="menu-item-125"
                        class="menu-item menu-item-type-taxonomy menu-item-object-category nav__item menu-item-125"><a
                            class="nav__link" target="_parent"
                            href="https://onlinexzone.com/category/index.html?type=health">Health</a></li>
                    <li id="menu-item-128"
                        class="menu-item menu-item-type-taxonomy menu-item-object-category nav__item menu-item-128"><a
                            class="nav__link" target="_parent"
                            href="https://onlinexzone.com/category/index.html?type=travel">Travel</a></li>
                    <li id="menu-item-123"
                        class="menu-item menu-item-type-taxonomy menu-item-object-category nav__item menu-item-123"><a
                            class="nav__link" target="_parent"
                            href="https://onlinexzone.com/category/index.html?type=auto">Auto</a></li>
                    <li id="menu-item-124"
                        class="menu-item menu-item-type-taxonomy menu-item-object-category nav__item menu-item-124"><a
                            class="nav__link" target="_parent"
                            href="https://onlinexzone.com/category/index.html?type=finance">Finance</a>
                    </li>
                    <li id="menu-item-127"
                        class="menu-item menu-item-type-taxonomy menu-item-object-category nav__item menu-item-127"><a
                            class="nav__link" target="_parent"
                            href="https://onlinexzone.com/category/index.html?type=tech">Tech</a></li>
                </ul>
            </nav>

        </header>
        <!-- <iframe src="../../components/head.html" frameborder="0" width="100%" height="98px"></iframe> -->

        <main class="main main--single-post main--featuredimage-none" id="main">
            <nav class="breadcrumb" aria-label="breadcrumb">
                <ol class="breadcrumb__list">
                    <!-- 面包屑 -->
                </ol>
            </nav>
            <h1 class="post-title" id="h2-0"> </h1>
            <!-- <time class="post-date post-created-date" datetime="2023-11-21">Published on Nov 21, 2023.</time> -->

            <p class="post-read-time"></p>

            <div class="author-info">
                <div class="author-info__avatar" style>
                    <img width="150" height="150"
                        src="../../assets/news/earth.png"
                        class="author-info__avatar-image" alt
                        decoding="async"
                        srcset="../../assets/news/earth.png 400w"
                        sizes="(max-width: 150px) 100vw, 150px" />
                </div>

                <p class="author-info__author" data-post-date="Nov 21, 2023"
                    data-updated-date="Nov 21, 2023">By <span
                        class="author-info__author-name"></span>
                </p>

            </div>

            <nav class="toc toc--sticky">
                <div class="toc__container">
                    <h2 class="toc__heading">Table of Contents</h2>
                    <button class="toc__toggle" type="button"
                        aria-label="Close Table of Contents">
                        <svg class="toc__toggle-icon" t="1725620702467"
                            class="icon" viewBox="0 0 1024 1024" version="1.1"
                            xmlns="http://www.w3.org/2000/svg" p-id="5202"
                            width="16" height="16"><path
                                d="M103.36376499999994 666.3830590000001L485.707294 284.039529a65.445647 65.445647 0 0 1 22.467765-7.105427357601002e-15L890.5185880000001 666.383059c1.2950590000000006 2.9515289999999994 1.3552940000000042 11.264 5.329070518200751e-15 22.497882000000004l-44.995763999999994 44.96564700000001c-11.745881999999998 1.295059000000002-20.208940999999996 1.3552940000000042-22.467765 7.105427357601002e-15l-314.88000000000005-314.84988199999987a20.178824 20.178824 0 0 0-22.467765 7.105427357601002e-15L170.82729400000022 733.8465880000001c-2.198587999999999 1.2649410000000008-10.661647 1.385412000000004-22.497882000000004 5.329070518200751e-15l-44.96564700000002-44.96564699999998c-1.2950590000000028-11.143528999999997-1.3552940000000078-19.516235-5.329070518200751e-15-22.497882000000004z"
                                p-id="5203" fill="#FF7723"></path></svg>
                    </button>
                    <ul class="toc__list">
                    </ul>
                </div>
            </nav>
            <article class="content" id="content">
                <img decoding="async"
                class="cdn-ih size-large wp-image-22810" width="1200" height="530"
                srcset="../../assets/news/loading.gif"
                sizes="(max-width:576px) 30vw, (max-width:992px) 50vw, (max-width:1400px) 100vw, 900w"
                data-url="../../assets/news/loading.gif" data-attr="../../assets/news/loading.gif"
                src="../../assets/news/loading.gif" loading="lazy" alt="news Image">


                <!-- <div class="ad-space hidden-on-desktop"
                    id="dfp-mobile-incontent-10"></div>posB -->
            </article>
            <aside class="sidebar sidebar--single-post">
                <!-- 文章右侧top1展示广告 -->

                <!-- <div class="sidebar__block sidebar__ad-space sidebar__ad-space--dfp-desktop-sidebar-top hidden-on-mobile">
                <div class="hidden-on-mobile" id="dfp-desktop-sidebar-top">
                    <script async
                        src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6907038225839490"
                        crossorigin="anonymous"></script>
                    <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6907038225839490"
                        data-ad-slot="2838871277" data-ad-format="auto" data-full-width-responsive="true"></ins>
                    <script>
                        (adsbygoogle = window.adsbygoogle || []).push({});
                    </script>
                </div>
            </div> -->
                <div class="sidebar__block">
                    <h2 class="section__heading section__heading--variation-3">
                        Related Posts </h2>
                    <div class="post-module post-module--variation-3">

                    </div>
                </div>
                <!-- 文章右侧top2下方广告 -->
                <!-- <div class="sidebar__block sidebar__ad-space hidden-on-mobile" id="dfp-desktop-sidebar-mid-1">
                <script async
                    src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6907038225839490"
                    crossorigin="anonymous"></script>
                <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6907038225839490"
                    data-ad-slot="3814738147" data-ad-format="auto" data-full-width-responsive="true"></ins>
                <script>
                    (adsbygoogle = window.adsbygoogle || []).push({});
                </script>
            </div> -->

            </aside>
        </main>
        <!-- <iframe src="./components/btmExplore.html" frameborder="0" width="100%"
     height="562px"></iframe> -->
        <!-- 底部版权 -->
        <!-- <iframe src="../../components/copyRight.html" frameborder="0" width="100%" height="0px"></iframe> -->
    </body>
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe
            src="https://www.googletagmanager.com/ns.html?id=GTM-WQKS4BKW"
            height="0" width="0"
            style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->


    <script src="../../utils/jquery.js"></script>
    <script type="module">
    import {getAllUrlParams, addHeadElment, newsTypeObj} from '../../utils/common.js'
    window.onload = function () {
        // 设置标题
        let pageTitleLow = getAllUrlParams().type || 'auto'
        let pageId = Number(getAllUrlParams().id) || 0

        let pageTitleUp = pageTitleLow.slice(0, 1).toUpperCase() + pageTitleLow.slice(1)
        sessionStorage.setItem('pageTitleLow', pageTitleLow)
        sessionStorage.setItem('pageTitleUp', pageTitleUp)

        // 设置内容几分钟阅读完
        const redTime = document.querySelector('.post-read-time')
        redTime.innerText = Math.floor(Math.random() * (10 + 1) + 1) + ' minutes read'
        // 设置文章所有信息
        const newsObj = newsTypeObj
        // 获取具体的文章详细信息
        const newsDetail = newsObj[pageTitleLow].find(item => {
            return item.id === pageId
        })
        
        // 添加seo优化标签
        const seoArr = [
            {
                name: 'title',
                property: {
                },
                text: `${newsDetail.newsTitle} - OnlineX`
            },
            {
                name: 'meta',
                property: {
                    content: newsDetail.seoText,
                    property: 'og:description'
                }
            },
            {
                name: 'meta',
                property: {
                    content: newsDetail.seoText,
                    name: 'description'
                }

            },
            {
                name: 'meta',
                property: {
                    content: newsDetail.imgUrl,
                    property: 'og:image'
                }

            },
            {
                name: 'meta',
                property: {
                    property: 'og:url',
                    content: `https://onlinexzone.com/category/detail/index.html?type=${pageTitleLow}&id=${newsDetail.id}`
                }
            },
            {
                name: 'link',
                property: {rel: 'canonical', href: `https://onlinexzone.com/category/detail/index.html?type=${pageTitleLow}&id=${newsDetail.id}`}
            },
            {
                name: 'meta',
                property: {
                    content: newsDetail.seoText,
                    name: 'description'
                }

            },
            {
                name: 'meta',
                property: {
                    content: newsDetail.seoText,
                    name: 'keywords'
                }

            },
        ]
        for (let i in seoArr) {
            addHeadElment(seoArr[i].name, seoArr[i].property, seoArr[i].text)
        }

        // 设置面包屑
        const breadcrumb__itemList = document.querySelector('.breadcrumb__list')
        let breadcrumbStr = ''
        if (pageTitleLow !== newsDetail.classfy) {
            breadcrumbStr = `<li class="breadcrumb__item"><a class="breadcrumb__link"
                        href="https://onlinexzone.com/news/index.html">Home</a>
                </li>
                <li class="breadcrumb__item"><a class="breadcrumb__link" href="../index.html?type=${pageTitleLow}">${pageTitleUp}</a></li>
                <li class="breadcrumb__item"><a class="breadcrumb__link" href="../seeMore/index.html?type=${newsDetail.classfy}">${newsDetail.classfy}</a></li>
                `
        } else {
            breadcrumbStr = `<li class="breadcrumb__item"><a class="breadcrumb__link"
                        href="https://onlinexzone.com/news/index.html">Home</a>
                </li>
                <li class="breadcrumb__item"><a class="breadcrumb__link" href="../index.html?type=${pageTitleLow}">${pageTitleUp}</a></li>
                `
        }

        breadcrumb__itemList.innerHTML = breadcrumbStr

        // 所有作者名字
        const authorList = [
            " John Smith", " Emma Johnson", " Michael Brown", " Olivia Davis", " William Wilson", " Sophia Martinez", " James Anderson", " Isabella Taylor", " Benjamin Thomas", " Mia Moore", " Lucas Jackson", " Amelia White", " Henry Harris", " Charlotte Martin", " Alexander Thompson", " Harper Garcia", " Daniel Martinez", " Evelyn Robinson", " Matthew Clark", " Abigail Lewis", " Joseph Walker", " Emily Hall", " David Allen", " Lily Young", " Samuel King", " Grace Wright", " Andrew Scott", " Chloe Green", " Joshua Adams", " Zoe Baker"
        ]
        const author_name = document.querySelector('.author-info__author-name')
        author_name.innerText = authorList[Math.floor(Math.random() * authorList.length)];

        // 设置左边文章导航栏
        const toc__list = document.querySelector('.toc__list')
        let posts = newsDetail.content.posts
        let postTitleStr = ""
        for (let i = 0; i < posts.length; i++) {
            postTitleStr += ` <li class="toc__item toc__item--bulleted">
                      <a class="toc__link" href="#h2-${i}">${posts[i].title}</a>
                  </li>`
        }
        toc__list.innerHTML = postTitleStr

        // 设置文章段落
        const H1title = document.querySelector('#h2-0')
        const H1Text = document.querySelector('.h2-0')
        H1title.innerText = posts[0].title
        // 第一段文字
        let P1TextStr = ''
        // 广告字符串
        let adsStr = ''
        // 文章广告特殊处理
        if(newsDetail.content.ads && newsDetail.content.adsBtnPosition=== 0){
            adsStr = '<div class="ads"><p>Related Topics</p><div class="adsContent">'
                for (let m = 0; m < 4; m++) {
                    adsStr += `<div class="adsBtn"><a href='${newsDetail.content.adsContent[0][m].linkUrl}'>${newsDetail.content.adsContent[0][m].text}</a></div>`
                }
                adsStr += '</div></div>'
            P1TextStr = `<p class="h2-0">${posts[0].text}</p>` + adsStr
        }else{
            P1TextStr = `<p class="h2-0">${posts[0].text}</p>`
        }
        // 详情大图
        $(".wp-image-22810").before(P1TextStr)
        $(".wp-image-22810").attr('srcset',newsDetail.imgUrl)
        $(".wp-image-22810").attr('data-url',newsDetail.imgUrl)
        $(".wp-image-22810").attr('src',newsDetail.imgUrl)
        $(".wp-image-22810").attr('data-attr',newsDetail.imgUrl)
        $(".wp-image-22810").attr('alt',newsDetail.newsTitle)

        let postsTextStr = ''
        for (let i = 1; i < posts.length; i++) {
            // 如果有广告就添加广告
            if (newsDetail.content.ads && i === 2 && newsDetail.content.adsBtnPosition !== 0) {
                adsStr = '<div class="ads"><p>Related Topics</p><div class="adsContent">'
                for (let m = 0; m < 4; m++) {
                    adsStr += `<div class="adsBtn"><a href='${newsDetail.content.adsContent[0][m].linkUrl}'>${newsDetail.content.adsContent[0][m].text}</a></div>`
                }
                adsStr += '</div></div>'

                postsTextStr = postsTextStr + adsStr + `      <h2 class="bulleted" id="h2-${i}">${posts[i].title}</h2>
            <p>${posts[i].text}</p>`
                continue
            //     <!--ip4，有广告加入上方p标签内-->
            // <div class="ad-space ad-space--dfp-mobile-incontent-${i} hidden-on-desktop">
            //     <div class="hidden-on-desktop" id="dfp-mobile-incontent-${i}"></div>
            // </div>
            }

            postsTextStr += `      <h2 class="bulleted" id="h2-${i}">${posts[i].title}</h2>
            <p>${posts[i].text}</p>`
            // <!--ip4,有广告加入到上方p标签内-->
            // <div class="ad-space ad-space--dfp-mobile-incontent-${i} hidden-on-desktop">
            //     <div class="hidden-on-desktop" id="dfp-mobile-incontent-${i}"></div>
            // </div>
        }

        $(".wp-image-22810").after(postsTextStr)
        const content = document.querySelector('#content')
        // content.innerHTML = P1TextStr + mainImgBoxStr + postsTextStr

        // 设置广告短button的大小
        let flag = newsDetail.content.adsShort
        if (flag){
            let adsBtns = document.querySelectorAll('.adsBtn')
            for (let i in adsBtns) {
                if(adsBtns[i].style){
                    adsBtns[i].classList.add("shortBtn")
                }
            }
        }
        // 设置推荐文章
        const relatedPosts = document.querySelector('.post-module--variation-3')
        const relatedList = newsObj[pageTitleLow].filter(item => {
            return item.id !== pageId
        })

        // 推荐随机
        let i = 0
        let relatedPostsStr = ''
        let randomNumArr = []
        for (let i = 0; i < relatedList.length; i++) {
            randomNumArr.push(relatedList[i].id)
        }
        while (i < 3) {
            let index = Math.floor(Math.random() * randomNumArr.length)
            let randomNum = randomNumArr[index]
            randomNumArr.splice(index, 1)

            const randomObj = relatedList.find(item => {
                return item.id === randomNum
            });

            relatedPostsStr += `<article class="post-module__item">
                        <a class="post-module__thumb-link" href="./index.html?type=${pageTitleLow}&id=${randomObj.id}">
                            <span class="screen-reader-text">${randomObj.newsTitle}</span>
                            <img loading='lazy' src=${randomObj.imgUrl}?image_process=quality,q_5'
                                data-attr=${randomObj.imgUrl}?image_process=quality,q_5'
                                data-url=${randomObj.imgUrl}?image_process=quality,q_5'
                                sizes='(max-width:576px) 30vw, (max-width:992px) 50vw, (max-width:1400px) 100vw, 900w'
                                width="600" height="315" data-src="${randomObj.imgUrl}?image_process=quality,q_5"
                                class="cdn-ih post-module__thumb wp-post-image" alt="" decoding="async"
                                srcset="${randomObj.imgUrl}?image_process=quality,q_5"
                                sizes="(max-width: 600px) 100vw, 600px" /><noscript><img width="600" height="315"
                                    src="${randomObj.imgUrl}?image_process=quality,q_5"
                                    class="post-module__thumb wp-post-image" alt="" decoding="async"
                                    srcset="${randomObj.imgUrl}?image_process=quality,q_5"
                                    sizes="(max-width: 600px) 100vw, 600px" /></noscript> </a>
                        <a class="post-module__category-link" href="https://www.onlineXzone.com/category/detail/index.html?type=${pageTitleLow}&id=${randomObj.id}"
                            aria-label="More from Health">
                            <span class="post-module__category">${pageTitleLow}</span>
                        </a>
                        <h3 class="post-module__heading">
                            <a class="post-module__heading-link" href="./index.html?type=${pageTitleLow}&id=${randomObj.id}">${randomObj.newsTitle}</a>
                        </h3>
                        <div class="post-module__description">
                            <p>${randomObj.newsTitle} [&hellip;]</p>
                        </div>
                        <a class="post-module__button"
                            href="${location.origin + '/news/category/seeMore/index.html?type=' + sessionStorage.getItem('pageTitleLow')}">Read More<span
                                class="screen-reader-text"> about What You Need To Know About Juicing</span></a>
                        <p class="post-module__read-time">4 minute read</p>
                    </article>`
            i++

        }
        relatedPosts.innerHTML = relatedPostsStr
    }

</script>

    <script>
    // 隐藏侧边导航栏
    const popout = document.querySelector('.popout')
    // 关闭按钮
    const popout__close = document.querySelector('.popout__close')
    // 遮罩
    const overlay = document.querySelector('.overlay')
    const hamburger = document.querySelector('.hamburger')

    // 手机端导航栏下拉按钮
    const toc__toggle = document.querySelector('.toc__toggle')
    const toc__toggle_close = document.querySelector('.toc__toggle_close')

    const activeSvg = document.querySelector('.toc__toggle-icon')
    const navBox = document.querySelector('.toc--sticky')
    
    const toc__list = document.querySelector('.toc__list')
    
    let activeFlag = true
    toc__toggle.addEventListener('click',function (event) {
        if(activeFlag){
            navBox.classList.add("toc--active");
            activeSvg.classList.add("up")
        }else{
            navBox.classList.remove("toc--active");
            activeSvg.classList.remove("up")
        }
        activeFlag = !activeFlag
        
    })
    toc__list.addEventListener('click',function () {
        navBox.classList.remove("toc--active");
        activeSvg.classList.remove("up")
    })
   

    hamburger.addEventListener('click', function () {
        blockAside();
    })
    popout__close.addEventListener('click', function () {
        // 不知道为啥添加上反而没效果，仅限于3级页面没效果，2级和1级有
        popout.classList.remove("popout--visible");
        overlay.classList.remove("overlay--visible")
        popout__close.classList.remove("popout__close--active")

    })
    function blockAside() {
        popout.classList.add("popout--transition", "popout--visible");
        overlay.classList.add("overlay--visible")
        popout__close.classList.add("popout__close--active")
        console.log('我是父页面的方法')
    }
    // 监听主题变化做的事
    let mqList = window.matchMedia('(prefers-color-scheme: dark)');
    const logoImg = document.querySelector('.logo__image')
    function switchColor() {
        if (mqList.matches) {
            // logoImg.src = logoImg.src.split('.png')[0] + '_dark' + '.png'
        }
    }
    switchColor()

    mqList.addEventListener('change', (event) => {
        // is dark mode
        if (event.matches) {
            switchColor()
        } else {
            // not dark mode
        }
    });

</script>

</html>